﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace BrsdServer
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class reg_ajax1 : IHttpHandler
    {
        user_infoEntity user_info = new user_infoEntity();
        userInfoBLL userBll = new userInfoBLL();
        MySqlDBHelper db = new MySqlDBHelper();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            String txtUser =context.Request.QueryString["user"];
            String txtPwd = context.Request.QueryString["pwd"];
            String txtTel = context.Request.QueryString["tel"];
            String txtEmail = context.Request.QueryString["email"];
            String txtAddr = context.Request.QueryString["addr"];
            
            user_info.user_name = txtUser;
            user_info.user_pwd = txtPwd;
            user_info.user_privilege = 0;
            user_info.user_lastlogin = DateTime.Now.ToString();
            user_info.user_registertime = DateTime.Now.ToString();
            user_info.user_tel = txtTel;
            user_info.user_email = txtEmail;
            user_info.user_loction = txtAddr;
            if (userBll.Insert(user_info) == 1)
            {
                context.Response.Write("1");
            }
            else
            {
                context.Response.Write("0");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
